<template>
	<section>
		<!--工具条-->
		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
			<el-form :inline="true" :model="filters">
				<el-form-item>
					<el-input v-model="filters.keyword" placeholder="关键字"></el-input>
				</el-form-item>
				<el-form-item>
					<el-button type="primary"  v-on:click="toPageOne">查询</el-button>
				</el-form-item>
			</el-form>
		</el-col>

		<!--列表-->
    <el-table :data="systemdictionarydetails" highlight-current-row v-loading="listLoading" style="width: 100%;">
      <el-table-column type="selection" width="100">
      </el-table-column>
      <el-table-column type="index" width="60">
      </el-table-column>
      <el-table-column prop="visitTime" label="访问时间" width="200" >
      </el-table-column>
      <el-table-column prop="visitwayName" label="访问方法名" width="120" >
      </el-table-column>
      <el-table-column prop="visitIp" label="访问Ip" width="120" >
      </el-table-column>
      

		</el-table>
    
		<!--工具条-->
		<el-col :span="24" class="toolbar">
<!--			<el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button>-->

			<el-pagination layout="prev, pager, next" @current-change="handleCurrentChange"  style="float:right;"
                     :page-size="pageSize"
                     :current-page="currentPage"
                     :total="total">
			</el-pagination>
		</el-col>


	</section>
</template>

<script>

	export default {
		data() {
			return {
				filters: {
          keyword: ''
				},
				systemdictionarydetails: [],//系统记录数据
				total: 0,//总条数
        currentPage: 1,
        pageSize: 5,
				listLoading: false,
			}
		},
		methods: {

		  //模糊查询
      toPageOne(){
        this.currentPage=1;
        this.getSystemrecords();
      },

			//当前页也改变
			handleCurrentChange(val) {
				this.currentPage = val;
				this.getSystemrecords();
			},

			//获取系统记录列表
			getSystemrecords() {
        // 忙等开启
        this.listLoading = true;
				let para = {
          currentPage:this.currentPage,
          pageSize:this.pageSize,
          keyword:this.filters.keyword
        }
        this.$http.post("/sysR",para)
            .then(result=>{

              this.systemdictionarydetails=result.data.rows;
              this.total=result.data.totals;
              // 忙等关闭
              this.listLoading = false;
        })
            .catch(result=>{
          this.$message({
            message: '网络不通！',
            type: 'error'
          });
        })
			},

		},
		mounted() {
			this.getSystemrecords();
		}
	}

</script>

<style scoped>

</style>